package com.zz.springboot.manager.impl;

import com.alibaba.excel.EasyExcel;
import com.zz.springboot.manager.ExcelDealManager;
import com.zz.springboot.mapper.AoMenMapper;
import com.zz.springboot.mapper.SecondSelectionMapper;
import com.zz.springboot.model.AoMen;
import com.zz.springboot.model.SecondSelection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExcelDealManagerImpl implements ExcelDealManager {


    @Autowired
    SecondSelectionMapper secondSelectionMapper;

    @Autowired
    AoMenMapper aoMenMapper;

    @Override
    public int insertSecondSelection(SecondSelection secondSelection) {
        return secondSelectionMapper.insert(secondSelection);
    }

    @Override
    public int insertBatchSecondSelection(List<SecondSelection> dataList) {
        return secondSelectionMapper.insertBatchSecondSelection(dataList);
    }

    @Override
    public SecondSelection selectSecondSelectionByType(Integer type) {
        /*
        Example example = new Example(SecondSelection.class);
        example.createCriteria().andEqualTo("type", type);
        List<SecondSelection> secondSelections = secondSelectionMapper.selectByExample(example);
        */
        return secondSelectionMapper.selectDataByType(type);

    }

}
